import PropTypes from "prop-types"
import { queryList } from "../apis/group"
import CommonModalPicker from "./common/CommonModalPicker"

const GroupPicker = ({
  onPick,
  disabled,
  disabledKeys = []
}) => {
  const columns = [
    {
      key: 'id',
      dataIndex: 'id',
      title: '用户组ID',
      width: 100
    },
    {
      key: 'name',
      dataIndex: 'name',
      title: '组名'
    },
  ]

  return <CommonModalPicker
    typeName="用户组"
    queryAction={queryList}
    columns={columns}
    disabledKeys={disabledKeys}
    disabled={disabled}
    onPick={onPick}
    getResData={res => res}
  ></CommonModalPicker>
}

GroupPicker.propTypes = {
  onPick: PropTypes.func,
  disabled: PropTypes.bool,
  disabledKeys: PropTypes.array
}

export default GroupPicker